package com.common.retrofit.method;

import com.common.Entity.FenLeiListEntity;
import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.DuoBaoService;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class FenLeiListMethods extends BaseMethods {

    private static FenLeiListMethods m_ins = null;

    public static FenLeiListMethods getInstance() {
        if (m_ins == null) {
            synchronized (FenLeiListMethods.class) {
                if (m_ins == null) {
                    m_ins = new FenLeiListMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Api/Goods/";
    }

    private DuoBaoService initService() {
        return getRetrofit().create(DuoBaoService.class);
    }


    public void     seeGood   (Subscriber<FenLeiListEntity> subscriber,
                      int uid ,
                      String hashid ,int  page
                                    ,String cid
    ) {
        String time  = System.currentTimeMillis()+"" ;
        Observable observable = initService().seeGood(time,
                SortUtils.getMyHash("uid"+uid,"hashid"+hashid ,"time"+time,"page"+page,"cid"+cid), Constans.ANDROID_APP_ID,"3",
                uid,hashid ,page ,cid
        );
        toSubscribe(observable, subscriber);
    }
}
